Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make INLINE compatible with C99 #170

Closed
wants to merge 1 commit into from
Closed

Conversation

RufUsul
Copy link

@RufUsul RufUsul commented Mar 14, 2022

Description of changes:
C99 has an incompatible inline behaviour but GCC provides the gnu_inline attribute to switch to the old behaviour.
It it suggested to check via __GNUC_STDC_INLINE__ if the new behaviour is active.

Without this change you get several warnings (or errors with -Werror) like this one when compiled in C99:
CommonDefs.h:622:14: error: inline function 'defaultMemAlloc' declared but never defined [-Werror]

Support for gnu_inline and __GNUC_STDC_INLINE__ was introduced in GCC 4.1.3 (current check is for 4.x) but it might be an option to always use the gnu_inline attribute.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

C99 has a different inline behaviour but provides the gnu_inline attribute to switch to the old behaviour.
it it suggested to check __GNUC_STDC_INLINE__ if the new behaviour is active.
@niyatim23
Copy link
Contributor

Thanks for your contribution. Closing in favor of #226

@niyatim23 niyatim23 closed this Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants